{{ define "title" }}
{{ .Title }} | {{ site.Title }}
{{ end }}

{{ define "main" }}
{{ $highlights := .RegularPages }}
{{ $versions := site.Data.docs.versions }}
{{ $latest := index $versions }}
{{ $highlights := .RegularPages }}
{{ $numVersions := len $versions }}
<div class="relative max-w-3xl md:max-w-5xl lg:max-w-7xl mx-auto px-6 lg:px-8">
  <div class="my-16">
    {{ partial "hero.html" . }}

    <!-- This example requires Tailwind CSS v2.0+ -->
    <div class="mt-12 flow-root">
      <ul class="-mb-8">
        {{ range $idx, $version := $versions }}
        {{ $isLast := eq $idx (sub $numVersions 1) }}
        {{ $thisVersionHighlights := where $highlights ".Params.release" "eq" . }}
        {{ if gt (len $thisVersionHighlights) 0 }}
        <li>
          <div class="relative pb-8 lg:pb-10">
            {{ if not $isLast }}
            <span class="absolute top-5 left-5 -ml-px h-full w-0.5 bg-gray-100 dark:bg-gray-700" aria-hidden="true"></span>
            {{ end }}

            <div class="relative flex items-start space-x-4 lg:space-x-6">
              <div>
                <span class="h-10 w-10 rounded-full flex items-center justify-center ring-4 bg-white ring-white dark:bg-dark dark:ring-dark">
                  {{/* Heroicon: outline/gear */}}
                  <svg xmlns="http://www.w3.org/2000/svg" class="text-purple-v dark:text-primary h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
                  </svg>
                </span>
              </div>

              <div class="min-w-0 flex-1">
                <div>
                  <div class="tracking-tight text-2xl lg:text-2.5xl text-gray-600 dark:text-gray-300">
                    Version {{ . }}
                  </div>
                </div>

                <div class="mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2.5 md:gap-4">
                  {{ range $thisVersionHighlights }}
                  {{ .Render "li" }}
                  {{ end }}
                </div>
              </div>
            </div>
          </div>
        </li>
        {{ end }}
        {{ end }}
      </ul>
    </div>
  </div>
</div>
{{ end }}